package com.itasura.balking;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @author sailor wang
 * @date 2018/9/6 下午1:06
 * @description
 */
public class Main {
    private static final Logger LOGGER = LoggerFactory.getLogger(WashingMachine.class);

    public static void main(String[] args) {
        final WashingMachine washingMachine = new WashingMachine();
        ExecutorService executorService = Executors.newFixedThreadPool(3);

        for (int i=0;i<4;i++){
            executorService.execute(washingMachine::wash);
        }
        executorService.shutdown();

        try {
            Boolean bool = executorService.awaitTermination(10, TimeUnit.SECONDS);
            LOGGER.info("bool -> {}",bool);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }


}